﻿<UserControl x:Class="GameFrameLibrary.Frames.GamingFrame"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:input="clr-namespace:Prism.Games.GalEngine.Scripts.Parser.Input;assembly=InputModel"
             xmlns:my="clr-namespace:GameFrameLibrary"
             mc:Ignorable="d" d:DesignHeight="720" d:DesignWidth="1280">
    <UserControl.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="SharedStyles.xaml" />
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </UserControl.Resources>

    <UserControl.InputBindings>
        <MouseBinding MouseAction="LeftClick" Command="input:GameCommands.Next" />
    </UserControl.InputBindings>

    <Grid Name="GameLayout" Background="Black">
        <Grid Name="GameFrameLayout">
            <Grid>
                <Grid Name="BackgroundLayout" Background="Black">
                    <Grid>
                        <Grid.Background>
                            <ImageBrush x:Name="BackgroundImage" Stretch="UniformToFill" />
                        </Grid.Background>
                        <Grid>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="1*" />
                                <RowDefinition Height="1*" />
                                <RowDefinition Height="1*" />
                                <RowDefinition Height="1*" />
                            </Grid.RowDefinitions>
                            <Canvas Grid.RowSpan="4" Name="VerticalImagesCanvas" />
                        </Grid>
                    </Grid>
                </Grid>
                <Grid Name="MenuLayout">
                    <Grid.RowDefinitions>
                        <RowDefinition Height="1*" />
                        <RowDefinition Height="1*" />
                        <RowDefinition Height="1*" />
                        <RowDefinition Height="1*" />
                    </Grid.RowDefinitions>
                    <Grid Grid.RowSpan="4" Name="SelectorGrid"/>
                    <ContentControl Name="ControlBarContent" Grid.Row="3" >
                        <ContentControl.Content>
                            <Grid>
                                <Grid.Background>
                                    <!--<ImageBrush ImageSource="Images/SBack.png" Opacity=".5" />-->
                                    <LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1" Opacity=".5" >
                                        <GradientStop Color="Transparent" Offset="0" />
                                        <GradientStop Color="Blue" Offset="1" />
                                    </LinearGradientBrush>
                                </Grid.Background>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto" />
                                    <ColumnDefinition />
                                </Grid.ColumnDefinitions>
                                <Grid Grid.Column="0" Width="180" Margin="5" >
                                    <Grid.Background>
                                        <ImageBrush x:Name="ExpressionImage"  />
                                    </Grid.Background>
                                </Grid>

                                <Grid Grid.Column="1" Name="ControlBarLayout" Visibility="Visible">
                                    <Grid.RowDefinitions>
                                        <RowDefinition Height="Auto" />
                                        <RowDefinition />
                                        <RowDefinition Height="Auto" />
                                    </Grid.RowDefinitions>

                                    <Grid Grid.Row="0" Name="RoleNameLayout">
                                        <Grid.ColumnDefinitions>
                                            <ColumnDefinition Width="Auto" />
                                        </Grid.ColumnDefinitions>
                                        <StackPanel Margin="25,5,25,5" Orientation="Horizontal" >
                                            <TextBlock Text="" FontSize="22" />
                                            <TextBlock Name="RoleName" Text="名字" FontSize="26" VerticalAlignment="Bottom" >
                                                        <TextBlock.Effect>
                                                              <DropShadowEffect Direction="0" ShadowDepth="0" BlurRadius="20" RenderingBias="Quality" />
                                                        </TextBlock.Effect>
                                            </TextBlock>
                                            <TextBlock Text="" FontSize="22"  />
                                        </StackPanel>
                                    </Grid>
                                    <Grid Grid.Row="1">
                                        <my:HyperTextBlock FontSize="28"  Grid.Column="1" x:Name="Dialogue" HyperTextInterval="00:00:00.040000" HyperText="对话部分" Foreground="White" Margin="25,5,25,5" TextWrapping="Wrap" TextTrimming="CharacterEllipsis" >
                                            <my:HyperTextBlock.Effect>
                                                <DropShadowEffect Direction="0" ShadowDepth="0" BlurRadius="20" RenderingBias="Quality" />
                                            </my:HyperTextBlock.Effect>
                                        </my:HyperTextBlock>

                                    </Grid>
                                    <Grid Grid.Row="2" Name="ControlButtonLayout" HorizontalAlignment="Right">
                                        <StackPanel Orientation="Horizontal" >
                                            <my:BoolenButton Foreground="White" Content="    Skip    " x:Name="Skip" FontSize="16" Width="100" Command="input:GameCommands.Skip" MouseEnter="Button_MouseEnter" >
                                                <!--<my:BoolenButton.Content>
                                                            <Image Source="Images/Skip.png" />
                                                        </my:BoolenButton.Content>
                                                        <my:BoolenButton.Template>
                                                            <ControlTemplate TargetType="my:BoolenButton">
                                                                <Border Name="B">
                                                                    <Grid Name="G">
                                                                        <Label HorizontalAlignment="Center" Foreground="White" >
                                                                            <Label.Content>
                                                                                <ContentPresenter />
                                                                            </Label.Content>
                                                                        </Label>
                                                                    </Grid>
                                                                </Border>
                                                                <ControlTemplate.Triggers>
                                                                    <Trigger Property="IsChecked" Value="true" >
                                                                        <Setter TargetName="G" Property="Background" >
                                                                            <Setter.Value>
                                                                                <ImageBrush ImageSource="Images/ButtonIsChecked.png" />
                                                                            </Setter.Value>
                                                                        </Setter>
                                                                    </Trigger>
                                                                    <Trigger Property="IsMouseOver" Value="true" >
                                                                        <Setter TargetName="B" Property="Background" >
                                                                            <Setter.Value>
                                                                                <ImageBrush ImageSource="Images/ButtonMouseOver.png" />
                                                                            </Setter.Value>
                                                                        </Setter>
                                                                    </Trigger>
                                                                </ControlTemplate.Triggers>
                                                            </ControlTemplate>
                                                        </my:BoolenButton.Template>-->
                                            </my:BoolenButton>
                                            <my:BoolenButton Foreground="White" Content="    Auto    " x:Name="Auto" FontSize="16" Width="100" Command="input:GameCommands.Auto" MouseEnter="Button_MouseEnter" >
                                                <!--<my:BoolenButton.Content>
                                                            <Image Source="Images/Auto.png" />
                                                        </my:BoolenButton.Content>
                                                        <my:BoolenButton.Template>
                                                            <ControlTemplate TargetType="my:BoolenButton">
                                                                <Border Name="B">
                                                                    <Grid Name="G">
                                                                        <Label HorizontalAlignment="Center" Foreground="White" >
                                                                            <Label.Content>
                                                                                <ContentPresenter />
                                                                            </Label.Content>
                                                                        </Label>
                                                                    </Grid>
                                                                </Border>
                                                                <ControlTemplate.Triggers>
                                                                    <Trigger Property="IsChecked" Value="true" >
                                                                        <Setter TargetName="G" Property="Background" >
                                                                            <Setter.Value>
                                                                                <ImageBrush ImageSource="Images/ButtonIsChecked.png" />
                                                                            </Setter.Value>
                                                                        </Setter>
                                                                    </Trigger>
                                                                    <Trigger Property="IsMouseOver" Value="true" >
                                                                        <Setter TargetName="B" Property="Background" >
                                                                            <Setter.Value>
                                                                                <ImageBrush ImageSource="Images/ButtonMouseOver.png" />
                                                                            </Setter.Value>
                                                                        </Setter>
                                                                    </Trigger>
                                                                </ControlTemplate.Triggers>
                                                            </ControlTemplate>
                                                        </my:BoolenButton.Template>-->
                                            </my:BoolenButton>
                                            <Button FontSize="16" Width="100" Command="input:GameCommands.HideMenu" MouseEnter="Button_MouseEnter" >
                                                <Button.Content>
                                                    <TextBlock Text="    Hide    " />
                                                    <!--<Image Source="Images/Hide.png" />-->
                                                </Button.Content>
                                            </Button>
                                            <Button FontSize="16" Width="100" Command="input:GameCommands.OpenLog" MouseEnter="Button_MouseEnter" >
                                                <Button.Content>
                                                    <TextBlock Text="    Log    " />
                                                    <!--<Image Source="Images/Log.png" />-->
                                                </Button.Content>
                                            </Button>
                                            <Button FontSize="16" Width="100" Command="input:GameCommands.SaveGame" MouseEnter="Button_MouseEnter" >
                                                <Button.Content>
                                                    <TextBlock Text="    Save    " />
                                                    <!--<Image Source="Images/Save.png" />-->
                                                </Button.Content>
                                            </Button>
                                            <Button FontSize="16" Width="100" Command="input:GameCommands.LoadGame" MouseEnter="Button_MouseEnter" >
                                                <Button.Content>
                                                    <TextBlock Text="    Load    " />
                                                    <!--<Image Source="Images/Load.png" />-->
                                                </Button.Content>
                                            </Button>
                                            <Button FontSize="16" Width="100" Command="input:GameCommands.Config" MouseEnter="Button_MouseEnter" >
                                                <Button.Content>
                                                    <TextBlock Text="    Config    " />
                                                    <!--<Image Source="Images/GConfig.png" />-->
                                                </Button.Content>
                                            </Button>
                                            <Button FontSize="16" Width="100" Command="input:GameCommands.Title" MouseEnter="Button_MouseEnter" >
                                                <Button.Content>
                                                    <TextBlock Text="    Title    " />
                                                    <!--<Image Source="Images/GTitle.png" />-->
                                                </Button.Content>
                                            </Button>
                                            <Button FontSize="16" Width="100" Command="input:GameCommands.Exit" MouseEnter="Button_MouseEnter" >
                                                <Button.Content>
                                                    <TextBlock Text="    Exit    " />
                                                    <!--<Image Source="Images/GExit.png" />-->
                                                </Button.Content>
                                            </Button>
                                        </StackPanel>
                                    </Grid>
                                </Grid>
                            </Grid>

                        </ContentControl.Content>
                    </ContentControl>
                    <Grid Grid.RowSpan="3" Grid.Row="0" >
                        <ListBox  Name="SelectorLB"  HorizontalContentAlignment="Center" VerticalContentAlignment="Center" Margin="0,100,0,100" ItemContainerStyle="{StaticResource SelectorListBoxItem}">
                            <ListBox.ItemTemplate>
                                <DataTemplate>
                                    <Grid Margin="5" MouseEnter="Button_MouseEnter">
                                        <TextBlock Text="{Binding Content}" FontSize="30" VerticalAlignment="Center" Style="{StaticResource TextBlockStyle}" Margin="100,10,100,10" />
                                        <Grid.InputBindings>
                                            <MouseBinding MouseAction="LeftClick" Command="input:GameCommands.ExecuteOption" CommandParameter="{Binding}" />
                                        </Grid.InputBindings>
                                    </Grid>
                                </DataTemplate>
                            </ListBox.ItemTemplate>
                        </ListBox>
                    </Grid>
                </Grid>
            </Grid>
        </Grid>
    </Grid>
</UserControl>

